<html>
<head>
<title>Docs for page game.lib.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">Game_library</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
        
                                                                            
                                                                                                              		  [ <a href="../classtrees_Game_library.html" class="menu">class tree: Game_library</a> ]
		  [ <a href="../elementindex_Game_library.html" class="menu">index: Game_library</a> ]
		  	    [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
      <b>Packages:</b><br />
              <a href="../li_default.html">default</a><br />
              <a href="../li_Database.html">Database</a><br />
              <a href="../li_Game_library.html">Game_library</a><br />
              <a href="../li_Main.html">Main</a><br />
              <a href="../li_Session_library.html">Session_library</a><br />
              <a href="../li_Table_library.html">Table_library</a><br />
              <a href="../li_User_library.html">User_library</a><br />
            <br /><br />
                        <b>Files:</b><br />
      	  <div class="package">
			<a href="../Game_library/_lib---game.lib.php.html">		game.lib.php
		</a><br>
			<a href="../Game_library/_lib---player.lib.php.html">		player.lib.php
		</a><br>
	  </div><br />
      
      
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1>Procedural File: game.lib.php</h1>
Source Location: /lib/game.lib.php<br /><br />

<br>
<br>


<h2>Page Details:</h2>
This file holds the library functions for game management.<br /><br /><br /><br />
<h4>Includes:</h4>
<div class="tags">
require_once(<a href="../default/_conf---game.conf.php.html">"conf/game.conf.php"</a>) [line 12]<br />
require_once(<a href="../Database/_lib---db.lib.php.html">"lib/db.lib.php"</a>) [line 10]<br />
require_once(<a href="../Table_library/_lib---table.lib.php.html">"lib/table.lib.php"</a>) [line 11]<br />
</div>
<br /><br />
<br /><br />
<br />
  <hr />
	<a name="functiongame_add_new"></a>
	<h3>game_add_new <span class="smalllinenumber">[line 21]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_add_new(
int $player_no)</code>
    </td></tr></table>
    </td></tr></table><br />

		Add a new game.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Game ID</strong> on success, <strong>FALSE</strong> on failure.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$player_no</b>&nbsp;&nbsp;</td>
        <td>Number of players.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_assoc_user"></a>
	<h3>game_assoc_user <span class="smalllinenumber">[line 52]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>void game_assoc_user(
int $game_id, Array $user_arr)</code>
    </td></tr></table>
    </td></tr></table><br />

		Associate users to a game.<br /><br />    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
		      <tr>
        <td class="type">Array&nbsp;&nbsp;</td>
        <td><b>$user_arr</b>&nbsp;&nbsp;</td>
        <td>Array of user ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_cal_buoy_num"></a>
	<h3>game_cal_buoy_num <span class="smalllinenumber">[line 323]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int game_cal_buoy_num(
Array $hand)</code>
    </td></tr></table>
    </td></tr></table><br />

		Calculate the total number of buoys of a hand.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>Total number of buoys.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">Array&nbsp;&nbsp;</td>
        <td><b>$hand</b>&nbsp;&nbsp;</td>
        <td>Array of cards in the hand.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_end_game"></a>
	<h3>game_end_game <span class="smalllinenumber">[line 877]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_end_game(
int $game_id, bool $end_now)</code>
    </td></tr></table>
    </td></tr></table><br />

		Perform end game action to a game.<br /><br /><p>set user points<br />  set game status.</p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Min waterlevel</strong> of game, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
		      <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$end_now</b>&nbsp;&nbsp;</td>
        <td>Override end round checking. (Default: FALSE)</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_end_round"></a>
	<h3>game_end_round <span class="smalllinenumber">[line 778]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_end_round(
int $game_id, [bool $end_now = FALSE])</code>
    </td></tr></table>
    </td></tr></table><br />

		Perform end round action to a game.<br /><br /><p>Use buoy remain to add points<br />  min waterlevel receive 1 more point<br />  Proceed to next round<br /></p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Min waterlevel</strong> of game, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
		      <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$end_now</b>&nbsp;&nbsp;</td>
        <td>Override end round checking. (Default: FALSE)</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_end_turn"></a>
	<h3>game_end_turn <span class="smalllinenumber">[line 655]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_end_turn(
int $game_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Perform end turn action to a game.<br /><br /><p>Determine if all players have palyed cards, <br />  assign corresponding waterlevel cards,<br />  minus buoy for highest waterlevel,<br />  kill user if no more buoy.<br />  proceed to next turn.</p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Min waterlevel</strong> of game, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_gen_player_hand"></a>
	<h3>game_gen_player_hand <span class="smalllinenumber">[line 344]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool game_gen_player_hand(
int $game_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Generate and set the player hand cards of a game.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_gen_waterlevel"></a>
	<h3>game_gen_waterlevel <span class="smalllinenumber">[line 274]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool game_gen_waterlevel(
int $game_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Generate and set the water level cards of a game.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_get_current_round"></a>
	<h3>game_get_current_round <span class="smalllinenumber">[line 173]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_get_current_round(
int $game_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Get the current round in a game;<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Current round</strong> of game, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_get_current_turn"></a>
	<h3>game_get_current_turn <span class="smalllinenumber">[line 196]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_get_current_turn(
int $game_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Get the current turn in a game;<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Current turn</strong> of game, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_get_num_of_players"></a>
	<h3>game_get_num_of_players <span class="smalllinenumber">[line 150]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_get_num_of_players(
int $game_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Get the number of players in a game;<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Number of player ID</strong> of game, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_get_status"></a>
	<h3>game_get_status <span class="smalllinenumber">[line 219]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_get_status(
int $game_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Get the status of a game;<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Status</strong> of game, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_get_turn_max_waterlevel"></a>
	<h3>game_get_turn_max_waterlevel <span class="smalllinenumber">[line 576]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_get_turn_max_waterlevel(
int $game_id, int $round, int $turn)</code>
    </td></tr></table>
    </td></tr></table><br />

		Get the max waterlevel card of a turn.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Max waterlevel</strong> of game, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$round</b>&nbsp;&nbsp;</td>
        <td>Round.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$turn</b>&nbsp;&nbsp;</td>
        <td>Turn.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_get_turn_min_waterlevel"></a>
	<h3>game_get_turn_min_waterlevel <span class="smalllinenumber">[line 602]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_get_turn_min_waterlevel(
int $game_id, int $round, int $turn)</code>
    </td></tr></table>
    </td></tr></table><br />

		Get the min waterlevel card of a turn.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Min waterlevel</strong> of game, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$round</b>&nbsp;&nbsp;</td>
        <td>Round.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$turn</b>&nbsp;&nbsp;</td>
        <td>Turn.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_get_users"></a>
	<h3>game_get_users <span class="smalllinenumber">[line 242]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>Array|FALSE game_get_users(
int $game_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Get all users in a game.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>An array holding the user ID of all users. <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_make_new"></a>
	<h3>game_make_new <span class="smalllinenumber">[line 483]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool game_make_new(
int $table_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Make a new game. (Config and set everything)<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$table_id</b>&nbsp;&nbsp;</td>
        <td>Table ID</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_num_of_active_player"></a>
	<h3>game_num_of_active_player <span class="smalllinenumber">[line 625]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE game_num_of_active_player(
int $game_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Calculate the number of active players in a game.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Number of active players</strong> of game, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_set_current_round"></a>
	<h3>game_set_current_round <span class="smalllinenumber">[line 438]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool game_set_current_round(
int $game_id, int $current_round)</code>
    </td></tr></table>
    </td></tr></table><br />

		Set the current round of a game.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$current_round</b>&nbsp;&nbsp;</td>
        <td>Current round</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_set_current_turn"></a>
	<h3>game_set_current_turn <span class="smalllinenumber">[line 460]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool game_set_current_turn(
int $game_id, int $current_turn)</code>
    </td></tr></table>
    </td></tr></table><br />

		Set the current turn of a game.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$current_turn</b>&nbsp;&nbsp;</td>
        <td>Current turn</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_set_player_hand"></a>
	<h3>game_set_player_hand <span class="smalllinenumber">[line 99]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool game_set_player_hand(
int $game_id, int $user_id, int $round, int $card)</code>
    </td></tr></table>
    </td></tr></table><br />

		Set the card of a user per card per round per game.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$user_id</b>&nbsp;&nbsp;</td>
        <td>User ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$round</b>&nbsp;&nbsp;</td>
        <td>Round.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$card</b>&nbsp;&nbsp;</td>
        <td>Card.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_set_player_waterlevel"></a>
	<h3>game_set_player_waterlevel <span class="smalllinenumber">[line 127]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool game_set_player_waterlevel(
int $game_id, int $user_id, int $round, int $turn, int $waterlevel, int $buoy_remain)</code>
    </td></tr></table>
    </td></tr></table><br />

		Set waterlevel of user per turn.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$user_id</b>&nbsp;&nbsp;</td>
        <td>User ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$round</b>&nbsp;&nbsp;</td>
        <td>Round.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$turn</b>&nbsp;&nbsp;</td>
        <td>Turn.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$waterlevel</b>&nbsp;&nbsp;</td>
        <td>Waterlevel.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$buoy_remain</b>&nbsp;&nbsp;</td>
        <td>Buoy remain.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_set_status"></a>
	<h3>game_set_status <span class="smalllinenumber">[line 414]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool game_set_status(
int $game_id, int $status)</code>
    </td></tr></table>
    </td></tr></table><br />

		Set a game status.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$status</b>&nbsp;&nbsp;</td>
        <td>Status (GAME_STATUS_READY) [1:Ready, 2:Playing, 3:Ended]</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_set_waterlevel"></a>
	<h3>game_set_waterlevel <span class="smalllinenumber">[line 74]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool game_set_waterlevel(
int $game_id, int $round, int $turn, int $max_waterlevel, int $min_waterlevel)</code>
    </td></tr></table>
    </td></tr></table><br />

		Set the waterlevel card of a turn of a round of a game.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$round</b>&nbsp;&nbsp;</td>
        <td>Round.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$turn</b>&nbsp;&nbsp;</td>
        <td>Turn.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$max_waterlevel</b>&nbsp;&nbsp;</td>
        <td>Max waterlevel card.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$min_waterlevel</b>&nbsp;&nbsp;</td>
        <td>Min waterlevel card.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiongame_start_game"></a>
	<h3>game_start_game <span class="smalllinenumber">[line 541]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool game_start_game(
int $game_id, int $current_turn)</code>
    </td></tr></table>
    </td></tr></table><br />

		Start a new game.<br /><br /><p>Set current round and turn to GAME_START_ROUND and GAME_START_TURN.  Set status to playing.  Cannot start a game that has started.</p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$current_turn</b>&nbsp;&nbsp;</td>
        <td>Current turn</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>

        <div class="credit">
		    <hr />
		    Documentation generated on Fri, 06 May 2011 03:43:23 +0000 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>